// pages/address/address.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        addressData:[
            // {
            //     name:'姓名',
            //     phone:'12345678910' ,
            //     site:'广东省',//地址
            //     toponymy:'地址地址地址dhizhid资质地址地址地址地址的地址',//详细地址
            // }
        ]
    },
    setAdd(){
        // console.log(this.data.addressData);
        let goodsAdd = wx.getStorageSync("goodsAdd");//获取数据
         wx.setStorageSync('goodsAdd', this.data.addressData);

        //  wx.navigateBack({
        //     url: '/pages/profile/profile',
        //   })

    },
    setProfile(){
        let prof = {
            flag:true,
        }
        let goodsPrices = wx.getStorageSync("goodsPrices");//获取数据
         wx.setStorageSync('goodsPrices', prof);
    },
    setPay(){
        let goodsAdd = wx.getStorageSync("goodsAdd");//获取数据
        wx.setStorageSync('goodsAdd', this.data.addressData);
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        // console.log(this.data);
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        let add = [];
        let goodsList = wx.getStorageSync("goodsList");//获取数据
        add.unshift({
            name:goodsList.name,
            phone:goodsList.phone,
            site:goodsList.site,
            toponymy:goodsList.toponymy
        })
        this.setData({
            addressData:add
        })
        // this.data.addressData.unshift(goodsList)
        // console.log(this.data.addressData);
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})